package com.xj.edu.hotel.service.serviceImpl;

import com.xj.edu.hotel.domain.Role;
import com.xj.edu.hotel.domain.RoleExample;
import com.xj.edu.hotel.mapper.RoleMapper;
import com.xj.edu.hotel.service.RoleService;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public Role findByRoleName(String roleType) {
        return roleMapper.selectByRoleName(roleType);
    }

    @Override
    public List<Role> findAllRoleType() {
        return roleMapper.findAllRoleType();
    }

    @Override
    public List<Role> findRoleByManagerId(String id) {
        return roleMapper.findRoleByManagerId(id);
    }

    @Override
    public Role findRoleDescriptionByRoleType(String roleType) {
        return roleMapper.findRoleDescriptionByRoleType(roleType);
    }
}
